<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
$JO["artistinfo"]= JO( array( "EN" => "Artist Information","VI"=>"Thông Tin Ca Sĩ") );
$JO["birth"]= JO( array( "EN" => "Birth","VI"=>"Ngày Sinh") );
$JO["nation"]= JO( array( "EN" => "Nation","VI"=>"Quốc Gia") );
$JO["autonym"]= JO( array( "EN" => "Autonym","VI"=>"Tên Thật") );
$JO["artist"]= JO( array( "EN" => "Artist","VI"=>"Ca Sĩ") );
$JO["album"]= JO( array( "EN" => "Album","VI"=>"Album") );
$JO["of"]= JO( array( "EN" => "of","VI"=>" của ") );
$JO["rbt"]= JO( array( "EN" => "Ring back tone","VI"=>"Nhạc Chờ") );
$JO["content"]= JO( array( "EN" => "Content","VI"=>"Nội Dung") );
$JO["view"]= JO( array( "EN" => "View","VI"=>"Xem") );
$JO["release"]= JO( array( "EN" => "Release","VI"=>"Phát hành") );
$JO["isempty"]= JO( array( "EN" => "is empty.","VI"=>"đang cập nhật.") );
?>

<span id="JO_album_content">
<div style="float: left;margin-bottom: 8px; width: 472px;">
    <span id="JO_albumloadding">
    <?
    $albumpage=isset($_REQUEST["albumpage"])?$_REQUEST["albumpage"]:1;
    $albumnum=5;
    if(isset($artist_key)){
        $dataalbum=ringbacktoneModule::getAlbumsofArtist_($artist_key,($albumpage-1),$albumnum);
    }else{
        $dataalbum=ringbacktoneModule::getAlbums(($albumpage-1),$albumnum);
    }
    if($dataalbum==null){
        echo "Không thấy album nào.";
    }else{
        foreach ($dataalbum as $rowalbum){
            ?>
            <div class="JO_album_item">
                <img class="imgalbumi" src="<?=(isset($rowalbum["image"])?$rowalbum["image"]:"JO_images/no_album2.gif")?>" />
                <div class="mar8i"></div>
                <div class="JO_albumcontent">
                    <div style="width: 252px;position: relative;" class="text">
                        <?=$JO["album"]?> : <a href="?JO_unit=002_album_detail&album=<?=md5($rowalbum["key"])?>"><?=(isset($rowalbum["subject"])?$rowalbum["subject"]:"[Album name is empty]")?></a>
                        
                    </div>
                    <div class="JO_album_release">
                        <?=$JO["release"]?> : <?=isset($rowalbum["release"])?$rowalbum["release"]:$JO["isempty"]?>
                    </div>
                    <div style="width: 372px;position: relative;" class="text">
                        <?=$JO["artist"]?> : <a href="?JO_unit=001_artist&artist=<?=md5($rowalbum["artist"])?>"><?=isset($rowalbum["name"])?$rowalbum["name"]:$JO["isempty"]?></a>
                        <div class="JO_album_view">
                            <a href="?JO_unit=002_album_detail&album=<?=md5($rowalbum["key"])?>">» <?=$JO["view"]?></a>
                        </div>
                    </div>
                    <div style="width: 372px;" class="text">
                        <?=$JO["content"]?> : <?=isset($rowalbum["content"])?$rowalbum["content"]:$JO["isempty"]?>
                    </div>
                </div>

            </div>
            <?
        }
        ?>
        <div class="JO_album_item">
            <img class="imgalbumi" src="http://image.bugsm.co.kr/album/images/75/2912/291231.jpg" />
            <div class="mar8i"></div>
            <div class="JO_albumcontent">
                <div style="width: 372px;position: relative;" class="text">
                    <a href="?JO_unit=002_album_detail">Abum name : I 'm going well</a>
                    <div class="JO_album_release">
                        Release : 00/00/0000
                    </div>
                </div>
                <div style="width: 372px;position: relative;" class="text">
                    Artist : 2NE1 (투애니원)
                    <div class="JO_album_view">
                        » View
                    </div>
                </div>
                <div style="width: 372px;" class="text">
                    Content : NE1 two on June 24 new songs: 'I am better than anybody I' published and authentic activities are at: The provocative title of ...
                </div>
            </div>

        </div>
        <div class="JO_album_item">
            <img class="imgalbumi" src="http://image.bugsm.co.kr/album/images/75/2828/282889.jpg"/>
            <div class="mar8i"></div>
            <div class="JO_albumcontent">
                <div style="width: 372px;position: relative;" class="text">
                    Abum name : Lonely
                    <div class="text JO_album_release">
                        Release : 00/00/0000
                    </div>
                </div>
                <div style="width: 372px;position: relative;" class="text">
                    Artist : 2NE1 (투애니원)
                    <div class="text JO_album_view">
                        » View
                    </div>
                </div>
                <div style="width: 372px;" class="text" title="매력적인 보컬그룹으로의 변신 2NE1의 [Lonely]
2NE1하면 떠오르는 퍼포먼스에 강한 그룹으로만 바라보던 시선을 이제 거두고 매력">
                    Content : 매력적인 보컬그룹으로의 변신 2NE1의 [Lonely]
2NE1하면 떠오르는 퍼포먼스에 강한 그룹으로만 바라보던 시선을 이제 거두고 매력...
                </div>
            </div>

        </div>
        <div class="JO_album_item">
            <img class="imgalbumi" src="http://image.bugsm.co.kr/album/images/75/1901/190115.jpg"/>
            <div class="mar8i"></div>
            <div class="JO_albumcontent">
                <div style="width: 372px;position: relative;" class="text">
                    Abum name : 2NE1 1st Mini Album
                    <div class="text JO_album_release">
                        Release : 00/00/0000
                    </div>
                </div>
                <div style="width: 372px;position: relative;" class="text">
                    Artist : 2NE1 (투애니원)
                    <div class="text JO_album_view">
                        » View
                    </div>
                </div>
                <div style="width: 372px;" class="text" title="타이틀곡 : I Don't Care">
                    Content : 2009년 상반기 최고의 신인 2NE1이 “롤리팝”과 “FIRE”에 이어 7월 1일 신곡 “I don’t care”를 전격 공개한다...
                </div>
            </div>

        </div>
        <div class="JO_album_item">
            <img class="imgalbumi" src="http://image.bugsm.co.kr/album/images/75/2942/294235.jpg"/>
            <div class="mar8i"></div>
            <div class="JO_albumcontent">
                <div style="width: 372px;position: relative;" class="text">
                    Abum name : 2NE1 2nd Mini Album
                    <div class="text JO_album_release">
                        Release : 00/00/0000
                    </div>
                </div>
                <div style="width: 372px;position: relative;" class="text">
                    Artist : 2NE1 (투애니원)
                    <div class="text JO_album_view">
                        » View
                    </div>
                </div>
                <div style="width: 372px;" class="text" title="타이틀곡 : I Don't Care">
                    Content : 2011년 2NE1은 박봄의 솔로곡 ‘Don’t Cry’를 시작으로 2NE1의 ‘Lonely’ ‘내가 제일 잘 나가’ ‘Hate You’까지 싱글 한 곡씩...
                </div>
            </div>

        </div>
        <div class="JO_album_item">
            <img class="imgalbumi" src="http://image.bugsm.co.kr/album/images/75/1974/197401.jpg"/>
            <div class="mar8i"></div>
            <div class="JO_albumcontent">
                <div style="width: 372px;position: relative;" class="text">
                    Abum name : I Don't Care (Reggae Mix ver.)
                    <div class="text JO_album_release">
                        Release : 00/00/0000
                    </div>
                </div>
                <div style="width: 372px;position: relative;" class="text">
                    Artist : 2NE1 (투애니원)
                    <div class="text JO_album_view">
                        » View
                    </div>
                </div>
                <div style="width: 372px;" class="text" title="타이틀곡 : I Don't Care">
                    Content : 타이틀곡 : I Don't Care (Reggae Mix ver.)...
                </div>
            </div>

        </div>
    </span>
    <div style="text-align: center;float: left;
width: 464px;line-height: 24px;margin-top: 4px;">
        <?
        if($dataalbum!=null){
            if(isset($artist_key)){
                $npages=ringbacktoneModule::getAlbumofArtist_numpage($artist_key,5);
            }else{
                $npages=ringbacktoneModule::getAlbums_numpage($albumnum);
            }
            
            $page=$albumpage;
            if($npages>1){

                if($page-5>1) echo "...";
                for($i=$page-5;$i<=($page+5);$i++){
                    if($i>0 && $i<=$npages){
                    echo "<a href='#i' class='JO_pagesi".(($i==$page)?" pageactive":"")."'>$i</a>";
                    }
                }
                if($page+4<$npages) echo "...";


            }
        }
        ?>

    </div>
        <?
    }
    ?>

</div>
</span>
<script>
function sendurl(p){
    var url="controller/JO_ajax_navigation.php?JO_controller=JO_ringbacktoneController";
    url+="&JO_action=show_album_artist";
    url+="<?=isset($artist_key)?("&artist=".$artist_key):""?>";
    url+="&albumpage="+p;
    var obj='#JO_album_content';
    $("#JO_albumloadding").html("<div style='text-align: center;padding: 8px 0px;width:472px;'><img src='JO_ICON/ajax-loader2.gif' alt=''/></div>");

    $('#JO_album_content').load(url,
        function(){
            //initpageclick();
            
        }
    );
}
function initpageclick(){
    $(".JO_pagesi").click(
        function(){
            var telco=$(".activetab").attr('id');
            sendurl($(this).html(),telco);
        }
    );
    $(".imgalbumi").hover(
        function(){
            //$(this).css("border","1px solid red");
        },
        function(){
            //$(this).css("border","1px solid #222");
        }
    );
    $(".imgalbumi").css("cursor","pointer");
    $(".imgalbumi").click(
        function(){
            location=($(this).next().next().children(":first-child").children(":first-child").attr("href"));
        }

    );

    }
initpageclick();
</script>